<?php

/**
 * 次级页面控制器
 */
class PageAction extends HomeAction {

    protected $mod;

    public function _initialize() {
        parent::_initialize();
        $this->mod = M('PayPage');
    }

    /**
     *  付费链接调转
     */
    public function show() {
        $pid  = format_int($_REQUEST['pid']);
        $page = $this->mod->find($pid);
        if ($page['end_time'] <= time()) {
            $this->error('次级页面已过期请续费');
        }
        if ($page['article_status'] != 1) {
            $this->error('次级页面已关闭或未审核');
        }

        //推荐信息
        $roundDZ = _roundDazhe();
        $this->assign('rounddz', $roundDZ);
        $this->assign('page', $page);
        $this->display();
    }

}
